home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD Exchange
/
CD Exchange - Volume 1.iso
/
utils
/
misc
/
ace
/
ace-2.0.lha
/
PRGS.lha
/
Turtle
/
snowflake.b
< prev
next >
Wrap
Text File
|
1994-01-10
|
836b
|
47 lines
'...fractal snowflake
'...you'll need a stack of about 40000 bytes for this one.
sub koch(depth,side)
if depth = 0 then
Forward(side)
else
koch(depth-1,side\3) : turnLeft(60)
koch(depth-1,side\3) : turnRight(120)
koch(depth-1,side\3) : turnLeft(60)
koch(depth-1,side\3) :
end if
end sub
sub snowflake(depth,side)
koch(depth,side) : turnRight(120)
koch(depth,side) : turnRight(120)
koch(depth,side) : turnRight(120)
end sub
window 1,"Fractal Snowflake",(0,0)-(640,250)
color 2,1
another$="Y"
while another$="Y"
cls
locate 1,1
input "Enter depth (try 4): ",depth
input "Enter sides (try 250): ",sides
cls
penup
setxy 200,225
pendown
snowflake(depth,sides)
locate 26,1
print "another (y/n)?"
another$=""
while another$<>"Y" and another$<>"N"
another$=ucase$(inkey$)
wend
wend
window close 1